package com.example.mapper;

import com.example.domain.Role;
import com.example.domain.UserRole;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserRoleMapper {
    @Insert("insert into user_role (id,user_id,role_id) values (#{id},#{userId},#{roleId})")
    void addUserAndRole(UserRole userRole);
    @Select("select * from role where name = #{name}")
    Role getRoleByName(String name);
}
